package com;

import java.util.HashMap;

public class Cookie {
	public static HashMap<String, Integer> getCookie(String s){
		HashMap<String, Integer> hashMap=new HashMap<String, Integer>();
		if((s!=null) && (!s.equals(""))){
			String[] onCookie=s.split(" ");
			String[] onPoint=onCookie[1].split(";");
			for(String partOnPoint: onPoint){
				String[] n=partOnPoint.split("=");
				Integer i=Integer.parseInt(n[1]);
					hashMap.put(n[0],i);				
			}										
			return hashMap;		
		}else{
			hashMap.put("jidsession",null);
			return hashMap;
		}
	}
}
